//
// Decompiled by Jadx - 444ms
//
package gc;

import android.text.TextUtils;
import android.widget.TextView;
import fi.c;
import fi.w;
import fm.l;
import fn.j;
import fn.p;
import fn.y;
import fp.aa;
import gc.ac;
import gc.co;
import gc.z;
import gf.i;
import gf.l;
import gf.x;
import gj.k;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.regex.Pattern;
import me.plusne.MainActivity;
import me.plusne.MyApp;
import me.plusne.NativeTools;
import me.plusne.common.Json.JsonHookStatic;
import okhttp3.ad;
import okhttp3.z;
import p.e;
import r.b;
import r.f;

public final class ce implements ac.b, ac.c, z.a, w.b, w.c, w.e, b.c, b.b, e.b {
    public final int a;

    public ce(int i) {
        this.a = i;
    }

    public final void b(String str, Object[] objArr) {
        f i;
        String str2;
        switch (this.a) {
            case 1:
                if (str.contains("success\":true")) {
                    i = f.i();
                    i.n();
                    str2 = "取消Ta对你的关注成功";
                } else {
                    i = f.i();
                    i.j();
                    str2 = "取消Ta对你的关注失败";
                }
                i.l(str2);
                return;
            case 6:
                HashMap hashMap = co.a;
                if (str.contains("\"message\":\"success\"")) {
                    f i2 = f.i();
                    i2.n();
                    i2.l("声音名片上传成功");
                    return;
                }
                androidx.activity.b.u(str);
                return;
            default:
                if (str.contains("\"message\":\"success\"")) {
                    f i3 = f.i();
                    i3.n();
                    i3.l("声音名片上传成功");
                    return;
                }
                androidx.activity.b.u(str);
                return;
        }
    }

    public final void call() {
        JsonHookStatic jsonHookStatic = y.by;
        new k(jsonHookStatic.getActivity());
        f fVar = new f(jsonHookStatic.getActivity());
        fVar.n();
        fVar.l("刷新成功");
        fi.y.d();
    }

    public final void e(Method method, Object[] objArr) {
        switch (this.a) {
            case 0:
                f i = f.i();
                i.n();
                i.l("发送成功");
                return;
            case 2:
                HashMap hashMap = co.a;
                f.i().m(objArr[0]);
                return;
            case 5:
                HashMap hashMap2 = co.a;
                if (method.getName().equals("onNext")) {
                    f i2 = f.i();
                    i2.n();
                    i2.l(j.as(objArr[0], "comeFromNew"));
                }
                if (method.getName().equals("onError")) {
                    androidx.activity.b.u("随机失败");
                    return;
                }
                return;
            case 18:
                int i3 = p.a;
                ap.dh++;
                return;
            default:
                int i4 = p.a;
                cv.e++;
                return;
        }
    }

    public final void f(l lVar) {
        HashMap hashMap = co.a;
        HashMap hashMap2 = new HashMap();
        StringBuilder sb = new StringBuilder();
        JsonHookStatic jsonHookStatic = y.by;
        sb.append(jsonHookStatic.getActivity().getCacheDir().getPath());
        sb.append("/");
        sb.append(System.currentTimeMillis());
        sb.append(".mp3");
        String sb2 = sb.toString();
        z.a aVar = new z.a();
        aVar.l(lVar.b);
        aVar.f("connection", "keep-alive");
        aVar.f("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36");
        aVar.j("GET", (ad) null);
        okhttp3.z g = aVar.g();
        f i = f.i();
        i.n();
        i.l("正在下载收藏语音到临时目录");
        jsonHookStatic.getOkHttpClient().a(g).aa(new co.a(sb2));
        hashMap2.put("voiceUrl", lVar.b);
        hashMap2.put("voiceSeconds", String.valueOf(lVar.d));
        ac acVar = new ac();
        acVar.de("https://api-user.soulapp.cn/user/voice/commit", hashMap2, "JSON");
        acVar.dg(new ce(6));
    }

    public final void g(w wVar, boolean z) {
        switch (this.a) {
            case 10:
                int i = i.b.a;
                if (z) {
                    new Thread((Runnable) new aa(12)).start();
                    return;
                }
                return;
            default:
                int i2 = x.e.a;
                if (z) {
                    fn.b.m(Boolean.TRUE, "CloseFriendTip2");
                    return;
                }
                return;
        }
    }

    public final void h(String str, String str2, w wVar, boolean z) {
        switch (this.a) {
            case 4:
                HashMap hashMap = co.a;
                if (z) {
                    y.co(str, "selectUserIdValue");
                    if (Pattern.compile("[0-9]*").matcher(str).matches()) {
                        str = z.do(str);
                    }
                    z.ef(str);
                    return;
                }
                return;
            case 11:
                int i = l.d.a;
                fn.b.j(690, gf.l.cs, str);
                Object obj = gf.w.cp;
                if (obj != null) {
                    j.aa(obj, "notifyDataSetChanged");
                    return;
                }
                return;
            default:
                TextView textView = gf.p.cp;
                if (z) {
                    String trim = str.trim();
                    if (TextUtils.isEmpty(trim)) {
                        y.co("", "secretFriend_allShowPass");
                        f i2 = f.i();
                        i2.n();
                        i2.l("已清除密码");
                        return;
                    }
                    y.co(NativeTools.d(trim), "secretFriend_allShowPass");
                    f i3 = f.i();
                    i3.n();
                    i3.l("密码设置成功:" + trim);
                    return;
                }
                return;
        }
    }

    public final void i(w wVar, c.a aVar, int i, int i2) {
        switch (this.a) {
            case 9:
                int i3 = ge.c.cp;
                wVar.az();
                fn.b.l(aVar.getTitle(), "setCountryName");
                fn.b.l(aVar.getKey(), "setCountry");
                return;
            default:
                String str = MainActivity.w;
                wVar.az();
                fn.b.l(Integer.valueOf(i2), "mode_night");
                int i4 = MyApp.a;
                int i5 = 2;
                int f = fn.b.f(2, "mode_night");
                if (f != 0) {
                    i5 = 1;
                    if (f != 1) {
                        i5 = -1;
                    }
                }
                androidx.appcompat.app.j.e(i5);
                return;
        }
    }
}
